package com.leetCode.ThreadDemo;

/**
 * 可重入锁
 */
public class ReentrantLockTest {

    public static void main(String[] args) {
        ReentrantLockTest reentrantLockTest = new ReentrantLockTest();
        reentrantLockTest.method1();
    }

    public synchronized void method1(){
        method2();
        System.out.println("invoke method1");
    }

    public synchronized void method2(){
        System.out.println("invoke method2");
    }
}
